package test;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

/**
 * @description:
 * @className: JDBCDrvices
 * @package: chapter07
 * @author: qiufeng@hsyuntai.com
 * @date: 2019/5/15 17:58
 * @copyright: 版权归 HSYUNTAI 所有
 */
public class JDBCDrvices {


    public static void main(String[] args) {
        try {
            //Class.forName("com.mysql.cj.jdbc.Driver");
            Connection connection = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/test?zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&characterEncoding=utf8&serverTimezone=UTC","root","123");
            Statement statement = connection.createStatement();
            ResultSet resultset = statement.executeQuery("select PARAM_NAME from pay_common_params limit 1");
            resultset.next();
            System.out.println(resultset.getString(1));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
